\usepackage[sort&compress]{natbib}

\usepackage{paralist}

\usepackage{listings}
\usepackage{lstmisc}

\usepackage{enumitem}

\usepackage{MnSymbol}

\usepackage{hyperref}
\usepackage[all]{hypcap}



\lstdefinestyle{nsfhaskell}{%
  language=Haskell,
  basicstyle=\small\ttfamily,
  commentstyle=,
  flexiblecolumns=false,
  basewidth={0.5em,0.45em},
  escapechar=\#,
%  numbers=left,numberstyle=\tiny,stepnumber=1,numbersep=5pt,firstnumber=1,
  deletekeywords={Monad,return,liftM,liftM2,id,=>,Functor,const,flip,maybe,undefined,lookup,String,show,Either,head,null,fst,snd,foldr,unfoldr,Int,length,sequence,zero,otherwise,mplus,mzero,listen,Prelude,even,odd,Bool},
  literate={~}{{$\sim$}}1
           {->}{{$\rightarrow$}}2
           {=>}{{$\Rightarrow$}}2
           {::}{{$\squaredots$}}1
           {$$}{{\$}}1
           {:.}{{$\circ$}}1
           {forall\ }{{$\forall$}}1
           {exists\ }{{$\exists$}}1
           {forall___}{{$\forall$}}1
           {exists___}{{$\exists$}}1
           {\ .}{{$\circ$}}2
           {\ .\ }{{$\circ$}}2
           {\ .||}{{ .||}}4
           {\ .|.}{{ .|.}}4
           {\ ...}{{ \ldots}}4
           {___...}{{ \ldots}}4
           {___}{{ }}1
           {\\}{{$\lambda$}}1
           {'\\NUL'}{{'\textbackslash NUL'}}5
}

\lstnewenvironment{haskell}{\lstset{style=nsfhaskell}\csname lst@SetFirstLabel\endcsname}{\csname lst@SaveFirstLabel\endcsname}
\lstnewenvironment{haskellq}{\lstset{style=nsfhaskell,xleftmargin=\parindent}\csname lst@SetFirstLabel\endcsname}{\csname lst@SaveFirstLabel\endcsname}

\newcommand{\pound}{\#}
\newcommand{\quotes}[1]{``#1''}

\lstMakeShortInline[style=nsfhaskell]`
\newcommand{\inlineHaskell}[1]{\text{\lstinline[style=nsfhaskell]{#1}}}




\newcommand{\tref}[2]{\hyperref[#2]{#1~\ref*{#2}}}
\newcommand{\Sref}[1]{\hyperref[#1]{\S~\ref*{#1}}}
\newcommand{\Nref}[1]{\hyperref[#1]{\ref*{#1}}}



%\newcommand{\todo}[1]{\marginpar{\tiny #1}}
\newcommand{\todo}[1]{}


\newcounter{nicknote}
\newenvironment{note}[2]%
{\noindent\ignorespaces\stepcounter{nicknote}\noindent \rule{0.5\textwidth}{3pt}
{\centering{\textsc{Note \arabic{nicknote}}: #2 --- by #1}\\}\vspace{-5pt}
\noindent \rule{0.5\textwidth}{1pt}}%
{\par\noindent\ignorespacesafterend\hspace{\stretch{1}}\textsc{End of Note} \rule{1ex}{1ex}}

\newenvironment{remark}{\paragraph{Remark}}{\vspace{1ex}}



\newcommand{\NB}{\emph{N.B.}}
\newcommand{\ie}{\emph{i.e.}}
\newcommand{\Ie}{\emph{I.e.}}
\newcommand{\eg}{\emph{e.g.}}
\newcommand{\cf}{\emph{c.f.}}
\newcommand{\etc}{\emph{etc}}
\newcommand{\yoko}{\texttt{yoko}}
\newcommand{\ig}{\texttt{instant}\texttt{-}\texttt{generics}}
\newcommand{\gd}{\texttt{generic}\texttt{-}\texttt{deriving}}
\newcommand{\casl}{{\sc Casl}}



\title{A Pattern for Almost Homomorphic Functions}
\authorinfo{Nicolas Frisby \and Andy Gill \and Perry Alexander}
  {Information Telecommunications and Technology Center\\The University of Kansas}
  {\{nfrisby,andygill,alex\}@ittc.ku.edu}
